Libraries required for this analysis

knitr::opts_chunk$set(fig.align="center") 
library(rstanarm)
library(tidyverse)
library(tidybayes)
library(modelr) 
library(ggplot2)
library(magrittr)  
library(emmeans)
library(bayesplot)
library(brms)
library(gganimate)

theme_set(theme_light())

In our experiment, we used a visualization recommendation algorithm (composed of one search algorithm and one oracle algorithm) to generate visualizations for the user on one of two datasets. We then asked the user to evaluate the tool on a variety of metrics (confidence in understanding data, confidence in answer, efficiency, ease of use, utility, and overall).

Given a search algorithm (bfs or dfs), an oracle (compassql or dziban), and a dataset (birdstrikes or movies), we would like to predict a user’s average score for a given metric. In addition, we would like to know if the choice of search algorithm and oracle has any meaningful impact on a user’s ratong for these metrics.

Read in and clean data

analyses = c("confidence.udata", "confidence.ans", "efficiency", "ease.of.use", "utility", "overall")
confidence_metrics = c("confidence.udata", "confidence.ans")
preference_metrics = c("efficiency", "ease.of.use", "utility", "overall")

user_response_data <- read.csv('processed_ptask_responses.csv')
analyses = c("confidence.udata", "confidence.ans", "efficiency", "ease.of.use", "utility", "overall")
user_response_data[,analyses] <- lapply(user_response_data[,analyses],ordered)
user_response_data <- user_response_data %>%
  mutate(
    dataset = as.factor(dataset),
    oracle = as.factor(oracle),
    search = as.factor(search),
    task = as.factor(task)
  )

models <- list()

search_differences <- list()
oracle_differences <- list()
alg_differences <- list()


seed = 12

Analysis for user responses

Confidence in Understanding Data: Building a Model

filename = "confidence_udata"
models$confidence_udata <- brm(
    formula = bf(confidence.udata ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$confidence_udata)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -1.76      0.21    -2.20    -1.37 1.00     1882
## Intercept[2]              -0.72      0.17    -1.05    -0.40 1.00     2115
## Intercept[3]               0.80      0.17     0.48     1.14 1.00     2183
## datasetmovies              0.02      0.15    -0.27     0.30 1.00     2685
## oracledziban               0.21      0.20    -0.18     0.62 1.00     1643
## searchdfs                 -0.18      0.20    -0.56     0.21 1.00     1741
## oracledziban:searchdfs     0.29      0.27    -0.25     0.81 1.00     1477
##                        Tail_ESS
## Intercept[1]               1872
## Intercept[2]               2156
## Intercept[3]               2177
## datasetmovies              1861
## oracledziban               1651
## searchdfs                  1896
## oracledziban:searchdfs     1766
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$confidence_udata)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$confidence_udata,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$confidence_udata,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for confidence in understanding the data using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_confidence_udata <- user_response_data %>%
  add_predicted_draws(models$confidence_udata,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
confidence_udata_plot <- draw_data_confidence_udata %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

confidence_udata_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_confidence_udata <- draw_data_confidence_udata %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_confidence_udata
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle    rating .lower .upper .width .point .interval
##   <fct>  <fct>      <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.939  0.643  1.20    0.95 mean   qi       
## 2 bfs    dziban     1.08   0.817  1.33    0.95 mean   qi       
## 3 dfs    compassql  0.811  0.533  1.08    0.95 mean   qi       
## 4 dfs    dziban     1.14   0.883  1.4     0.95 mean   qi       
## 5 bfs    compassql  0.939  0.857  1.04    0.5  mean   qi       
## 6 bfs    dziban     1.08   0.983  1.17    0.5  mean   qi       
## 7 dfs    compassql  0.811  0.717  0.904   0.5  mean   qi       
## 8 dfs    dziban     1.14   1.05   1.23    0.5  mean   qi
## Saving 7 x 5 in image

Confidence in Understanding Data: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

confidence_udata_predictive_data <- user_response_data %>% add_predicted_draws(models$confidence_udata, seed = seed, re_formula = NA) 
confidence_udata_predictive_data$alg <- paste(confidence_udata_predictive_data$search, confidence_udata_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$confidence_udata <- confidence_udata_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$confidence_udata$metric = "confidence.udata"

search_differences$confidence_udata %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.udata")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$confidence_udata[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$confidence_udata <- confidence_udata_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$confidence_udata$metric = "confidence.udata"

oracle_differences$confidence_udata %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.udata")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$confidence_udata[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$confidence_udata <- confidence_udata_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$confidence_udata <- subset(alg_differences$confidence_udata, alg == "dfs compassql - bfs dziban")
alg_differences$confidence_udata$metric = "confidence.udata"

alg_differences$confidence_udata %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.udata")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$confidence_udata[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Confidence in Answer: Building a Model

filename = "confidence_ans"
models$confidence_ans <- brm(
    formula = bf(confidence.ans ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$confidence_ans)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -2.65      0.39    -3.51    -1.98 1.00     1490
## Intercept[2]              -1.67      0.21    -2.08    -1.27 1.00     2209
## Intercept[3]              -0.84      0.17    -1.18    -0.51 1.00     2188
## Intercept[4]               0.60      0.17     0.28     0.94 1.00     2132
## datasetmovies             -0.11      0.14    -0.39     0.17 1.00     2570
## oracledziban               0.33      0.20    -0.05     0.72 1.00     1558
## searchdfs                  0.11      0.20    -0.26     0.49 1.00     1622
## oracledziban:searchdfs    -0.11      0.27    -0.65     0.43 1.00     1264
##                        Tail_ESS
## Intercept[1]               1522
## Intercept[2]               2592
## Intercept[3]               2239
## Intercept[4]               2369
## datasetmovies              1938
## oracledziban               2048
## searchdfs                  1694
## oracledziban:searchdfs     1594
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$confidence_ans)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$confidence_ans,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$confidence_ans,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for confidence in answer using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_confidence_ans <- user_response_data %>%
  add_predicted_draws(models$confidence_ans,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
confidence_ans_plot <- draw_data_confidence_ans %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

confidence_ans_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_confidence_ans <- draw_data_confidence_ans %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_confidence_ans
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle    rating .lower .upper .width .point .interval
##   <fct>  <fct>      <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.976  0.661   1.27   0.95 mean   qi       
## 2 bfs    dziban     1.20   0.917   1.47   0.95 mean   qi       
## 3 dfs    compassql  1.05   0.75    1.32   0.95 mean   qi       
## 4 dfs    dziban     1.20   0.917   1.45   0.95 mean   qi       
## 5 bfs    compassql  0.976  0.875   1.07   0.5  mean   qi       
## 6 bfs    dziban     1.20   1.12    1.3    0.5  mean   qi       
## 7 dfs    compassql  1.05   0.967   1.15   0.5  mean   qi       
## 8 dfs    dziban     1.20   1.12    1.3    0.5  mean   qi
## Saving 7 x 5 in image

Confidence in Answer: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

confidence_ans_predictive_data <- user_response_data %>% add_predicted_draws(models$confidence_ans, seed = seed, re_formula = NA) 
confidence_ans_predictive_data$alg <- paste(confidence_ans_predictive_data$search, confidence_ans_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$confidence_ans <- confidence_ans_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$confidence_ans$metric = "confidence.ans"

search_differences$confidence_ans %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.ans")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$confidence_ans[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$confidence_ans <- confidence_ans_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$confidence_ans$metric = "confidence.ans"

oracle_differences$confidence_ans %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.ans")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$confidence_ans[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$confidence_ans <- confidence_ans_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$confidence_ans <- subset(alg_differences$confidence_ans, alg == "dfs compassql - bfs dziban")
alg_differences$confidence_ans$metric = "confidence.ans"

alg_differences$confidence_ans %>%
      ggplot(aes(x = diff_in_rating, y = "confidence.ans")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$confidence_ans[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Efficiency: Building a Model

filename = "efficiency"
models$efficiency <- brm(
    formula = bf(efficiency ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$efficiency)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -1.81      0.19    -2.19    -1.44 1.00     1981
## Intercept[2]              -0.79      0.16    -1.11    -0.48 1.00     2551
## Intercept[3]              -0.19      0.16    -0.52     0.11 1.00     2477
## Intercept[4]               0.72      0.16     0.40     1.03 1.00     2453
## datasetmovies              0.10      0.13    -0.16     0.35 1.00     3073
## oracledziban               0.07      0.19    -0.31     0.43 1.00     2095
## searchdfs                 -0.68      0.19    -1.06    -0.31 1.00     2035
## oracledziban:searchdfs     0.36      0.25    -0.15     0.86 1.00     1714
##                        Tail_ESS
## Intercept[1]               2043
## Intercept[2]               2262
## Intercept[3]               2697
## Intercept[4]               2279
## datasetmovies              2201
## oracledziban               1921
## searchdfs                  1972
## oracledziban:searchdfs     1741
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$efficiency)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$efficiency,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$efficiency,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for efficiency using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_efficiency <- user_response_data %>%
  add_predicted_draws(models$efficiency,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
efficiency_plot <- draw_data_efficiency %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

efficiency_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_efficiency <- draw_data_efficiency %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_efficiency
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle    rating  .lower .upper .width .point .interval
##   <fct>  <fct>      <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.610  0.214  1.02     0.95 mean   qi       
## 2 bfs    dziban     0.682  0.283  1.07     0.95 mean   qi       
## 3 dfs    compassql -0.135 -0.55   0.267    0.95 mean   qi       
## 4 dfs    dziban     0.339 -0.0833 0.75     0.95 mean   qi       
## 5 bfs    compassql  0.610  0.464  0.75     0.5  mean   qi       
## 6 bfs    dziban     0.682  0.55   0.817    0.5  mean   qi       
## 7 dfs    compassql -0.135 -0.283  0.0167   0.5  mean   qi       
## 8 dfs    dziban     0.339  0.2    0.483    0.5  mean   qi
## Saving 7 x 5 in image

Efficiency: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

efficiency_predictive_data <- user_response_data %>% add_predicted_draws(models$efficiency, seed = seed, re_formula = NA) 
efficiency_predictive_data$alg <- paste(efficiency_predictive_data$search, efficiency_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$efficiency <- efficiency_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$efficiency$metric = "efficiency"

search_differences$efficiency %>%
      ggplot(aes(x = diff_in_rating, y = "efficiency")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$efficiency[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$efficiency <- efficiency_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$efficiency$metric = "efficiency"

oracle_differences$efficiency %>%
      ggplot(aes(x = diff_in_rating, y = "efficiency")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$efficiency[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$efficiency <- efficiency_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$efficiency <- subset(alg_differences$efficiency, alg == "dfs compassql - bfs dziban")
alg_differences$efficiency$metric = "efficiency"


alg_differences$efficiency %>%
      ggplot(aes(x = diff_in_rating, y = "efficiency")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$efficiency[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Ease of Use: Building a Model

filename = "ease_of_use"
models$ease_of_use <- brm(
    formula = bf(ease.of.use ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$ease_of_use)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -2.24      0.23    -2.69    -1.80 1.00     2196
## Intercept[2]              -1.19      0.18    -1.55    -0.84 1.00     2361
## Intercept[3]              -0.55      0.17    -0.88    -0.22 1.00     2300
## Intercept[4]               0.84      0.17     0.52     1.18 1.00     2561
## datasetmovies              0.26      0.14    -0.01     0.53 1.00     2980
## oracledziban              -0.10      0.19    -0.49     0.27 1.00     2061
## searchdfs                 -0.83      0.20    -1.22    -0.45 1.00     2057
## oracledziban:searchdfs     0.46      0.27    -0.05     1.00 1.00     1843
##                        Tail_ESS
## Intercept[1]               2241
## Intercept[2]               2532
## Intercept[3]               2241
## Intercept[4]               2551
## datasetmovies              2069
## oracledziban               2072
## searchdfs                  1931
## oracledziban:searchdfs     2009
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$ease_of_use)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$ease_of_use,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$ease_of_use,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for ease of use using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_ease_of_use <- user_response_data %>%
  add_predicted_draws(models$ease_of_use,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
ease_of_use_plot <- draw_data_ease_of_use %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

ease_of_use_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_ease_of_use <- draw_data_ease_of_use %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_ease_of_use
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle    rating  .lower .upper .width .point .interval
##   <fct>  <fct>      <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.881  0.536   1.20    0.95 mean   qi       
## 2 bfs    dziban     0.802  0.483   1.12    0.95 mean   qi       
## 3 dfs    compassql  0.133 -0.233   0.5     0.95 mean   qi       
## 4 dfs    dziban     0.474  0.1     0.817   0.95 mean   qi       
## 5 bfs    compassql  0.881  0.768   1       0.5  mean   qi       
## 6 bfs    dziban     0.802  0.7     0.917   0.5  mean   qi       
## 7 dfs    compassql  0.133  0.0167  0.25    0.5  mean   qi       
## 8 dfs    dziban     0.474  0.35    0.6     0.5  mean   qi
## Saving 7 x 5 in image

Ease of Use: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

ease_of_use_predictive_data <- user_response_data %>% add_predicted_draws(models$ease_of_use, seed = seed, re_formula = NA) 
ease_of_use_predictive_data$alg <- paste(ease_of_use_predictive_data$search, ease_of_use_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$ease_of_use <- ease_of_use_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$ease_of_use$metric = "ease.of.use"

search_differences$ease_of_use %>%
      ggplot(aes(x = diff_in_rating, y = "ease.of.use")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$ease_of_use[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$ease_of_use <- ease_of_use_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$ease_of_use$metric = "ease.of.use"

oracle_differences$ease_of_use %>%
      ggplot(aes(x = diff_in_rating, y = "ease.of.use")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$ease_of_use[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$ease_of_use <- ease_of_use_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$ease_of_use <- subset(alg_differences$ease_of_use, alg == "dfs compassql - bfs dziban")
alg_differences$ease_of_use$metric = "ease.of.use"

alg_differences$ease_of_use %>%
      ggplot(aes(x = diff_in_rating, y = "ease.of.use")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$ease_of_use[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Utility: Building a Model

filename = "utility"
models$utility <- brm(
    formula = bf(utility ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$utility)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -1.45      0.19    -1.81    -1.09 1.00     2029
## Intercept[2]              -0.55      0.16    -0.85    -0.24 1.00     2528
## Intercept[3]              -0.08      0.16    -0.39     0.23 1.00     2476
## Intercept[4]               0.87      0.16     0.55     1.19 1.00     2610
## datasetmovies              0.16      0.13    -0.10     0.43 1.00     2610
## oracledziban               0.16      0.19    -0.21     0.53 1.00     1979
## searchdfs                 -0.42      0.19    -0.78    -0.07 1.00     2086
## oracledziban:searchdfs     0.18      0.26    -0.33     0.69 1.00     1840
##                        Tail_ESS
## Intercept[1]               2008
## Intercept[2]               2531
## Intercept[3]               2364
## Intercept[4]               2380
## datasetmovies              1999
## oracledziban               2087
## searchdfs                  2177
## oracledziban:searchdfs     1820
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$utility)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$utility,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$utility,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for Utility using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_utility <- user_response_data %>%
  add_predicted_draws(models$utility,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
utility_plot <- draw_data_utility %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

utility_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_utility <- draw_data_utility %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_utility
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle     rating  .lower .upper .width .point .interval
##   <fct>  <fct>       <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.449   0.0179  0.857   0.95 mean   qi       
## 2 bfs    dziban     0.627   0.2     1.03    0.95 mean   qi       
## 3 dfs    compassql -0.0436 -0.467   0.383   0.95 mean   qi       
## 4 dfs    dziban     0.350  -0.0833  0.75    0.95 mean   qi       
## 5 bfs    compassql  0.449   0.304   0.607   0.5  mean   qi       
## 6 bfs    dziban     0.627   0.483   0.767   0.5  mean   qi       
## 7 dfs    compassql -0.0436 -0.183   0.1     0.5  mean   qi       
## 8 dfs    dziban     0.350   0.2     0.5     0.5  mean   qi
## Saving 7 x 5 in image

Utility: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

utility_predictive_data <- user_response_data %>% add_predicted_draws(models$utility, seed = seed, re_formula = NA) 
utility_predictive_data$alg <- paste(utility_predictive_data$search, utility_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$utility <- utility_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$utility$metric = "utility"

search_differences$utility %>%
      ggplot(aes(x = diff_in_rating, y = "utility")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$utility[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$utility <- utility_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$utility$metric = "utility"

oracle_differences$utility %>%
      ggplot(aes(x = diff_in_rating, y = "utility")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$utility[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$utility <- utility_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$utility <- subset(alg_differences$utility, alg == "dfs compassql - bfs dziban")
alg_differences$utility$metric = "utility"

alg_differences$utility %>%
      ggplot(aes(x = diff_in_rating, y = "utility")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$utility[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Overall: Building a Model

filename = "overall"
models$overall <- brm(
    formula = bf(overall ~ dataset + oracle * search),
    family = cumulative("probit"),
    prior = prior(normal(0, 1), class = b),
    chains = 2,
    cores = 2,
    iter = 2500,
    warmup = 1000,
    data = data,
    control = list(adapt_delta = 0.99),
    file = filename,
    seed = seed
  )

Check some diagnostics regarding our model. Rhat should be close to 1 and Bulk_ESS should be in the thousands.

summary(models$overall)
##  Family: cumulative 
##   Links: mu = probit; disc = identity 
## Formula: y ~ dataset + oracle * search 
##    Data: data (Number of observations: 236) 
## Samples: 2 chains, each with iter = 2500; warmup = 1000; thin = 1;
##          total post-warmup samples = 3000
## 
## Population-Level Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept[1]              -2.09      0.22    -2.53    -1.65 1.00     1855
## Intercept[2]              -1.23      0.18    -1.59    -0.89 1.00     2052
## Intercept[3]              -0.43      0.16    -0.76    -0.11 1.00     2004
## Intercept[4]               0.85      0.17     0.51     1.16 1.00     2143
## datasetmovies             -0.10      0.13    -0.37     0.15 1.00     3068
## oracledziban               0.07      0.19    -0.32     0.45 1.00     1777
## searchdfs                 -0.40      0.19    -0.78    -0.03 1.00     1588
## oracledziban:searchdfs     0.20      0.27    -0.32     0.71 1.00     1533
##                        Tail_ESS
## Intercept[1]               1989
## Intercept[2]               2214
## Intercept[3]               2239
## Intercept[4]               2367
## datasetmovies              2048
## oracledziban               1932
## searchdfs                  1668
## oracledziban:searchdfs     1498
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00 1.00     3000     3000
## 
## Samples were drawn using sampling(NUTS). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Trace plots help us check whether there is evidence of non-convergence for our model.

plot(models$overall)

In our pairs plots, we want to make sure we don’t have highly correlated parameters (highly correlated parameters means that our model has difficulty differentiating the effect of such parameters).

pairs(
  models$overall,
  pars = c("b_Intercept[1]",
           "b_Intercept[2]",
           "b_Intercept[3]"),
  fixed = TRUE
)

pairs(
  models$overall,
  pars = c("b_datasetmovies",
           "b_oracledziban",
           "b_searchdfs"),
  fixed = TRUE
)

We now look at a average response for Overall using different combinations of search and oracle via draws from the model posterior. The thicker, shorter line represents the 95% credible interval, while the thinner, longer line represents the 50% credible interval.

draw_data_overall <- user_response_data %>%
  add_predicted_draws(models$overall,
                   seed = seed,
                   re_formula = NA) %>%
  group_by(search, oracle, .draw) %>%
  mutate(rating = weighted.mean(as.numeric(as.character(.prediction))))
  
overall_plot <- draw_data_overall %>%
  ggplot(aes(x = oracle, y = rating)) +
  stat_eye(.width = c(.95, .5)) +
  theme_minimal() +
  coord_cartesian(ylim = c(-2, 2)) +
  facet_grid(. ~ search)

overall_plot

We can get the numeric values of the interval boundaries shown above with mean_qi

fit_info_overall <- draw_data_overall %>% group_by(search, oracle) %>% mean_qi(rating, .width = c(.95, .5))
fit_info_overall
## # A tibble: 8 x 8
## # Groups:   search [2]
##   search oracle    rating  .lower .upper .width .point .interval
##   <fct>  <fct>      <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs    compassql  0.686  0.321   1.04    0.95 mean   qi       
## 2 bfs    dziban     0.744  0.4     1.07    0.95 mean   qi       
## 3 dfs    compassql  0.304 -0.0833  0.65    0.95 mean   qi       
## 4 dfs    dziban     0.561  0.2     0.9     0.95 mean   qi       
## 5 bfs    compassql  0.686  0.571   0.804   0.5  mean   qi       
## 6 bfs    dziban     0.744  0.633   0.867   0.5  mean   qi       
## 7 dfs    compassql  0.304  0.183   0.433   0.5  mean   qi       
## 8 dfs    dziban     0.561  0.45    0.683   0.5  mean   qi
## Saving 7 x 5 in image

Overall: Differences Between Conditions

Next, we want to see if there is any significant difference in completion time between the two search algorithms (bfs and dfs) and the two oracles (dzbian and compassql).

overall_predictive_data <- user_response_data %>% add_predicted_draws(models$overall, seed = seed, re_formula = NA) 
overall_predictive_data$alg <- paste(overall_predictive_data$search, overall_predictive_data$oracle)

Differences in user score by search algorithm.

search_differences$overall <- overall_predictive_data %>% 
  group_by(search, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = search) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'search' (override with `.groups` argument)
search_differences$overall$metric = "overall"

search_differences$overall %>%
      ggplot(aes(x = diff_in_rating, y = "overall")) +
      xlab(paste0("Expected Difference in Rating (",search_differences$overall[1,'search'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by oracle.

oracle_differences$overall <- overall_predictive_data %>% 
  group_by(oracle, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = oracle) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'oracle' (override with `.groups` argument)
oracle_differences$overall$metric = "overall"

oracle_differences$overall %>%
      ggplot(aes(x = diff_in_rating, y = "overall")) +
      xlab(paste0("Expected Difference in Rating (",oracle_differences$overall[1,'oracle'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Differences in user score by search and oracle combination (dfs compassql vs bfs dziban only)

alg_differences$overall <- overall_predictive_data %>% 
  group_by(alg, .draw) %>%
   summarize(rating = weighted.mean(as.numeric(.prediction))) %>%
   compare_levels(rating, by = alg) %>%
   rename(diff_in_rating = rating)
## `summarise()` regrouping output by 'alg' (override with `.groups` argument)
alg_differences$overall <- subset(alg_differences$overall, alg == "dfs compassql - bfs dziban")
alg_differences$overall$metric = "overall"

alg_differences$overall %>%
      ggplot(aes(x = diff_in_rating, y = "overall")) +
      xlab(paste0("Expected Difference in Rating (",alg_differences$overall[1,'alg'],")")) + 
      ylab("Condition")+
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

Summary Plots

Putting the all of the plots for search algorithm and oracle differences together, split by whether the rating metric is of type confidence or preference We’ll start with differences in search algorithms.

Differences in Search Algorithms

combined_search_differences <- rbind(search_differences$confidence_udata, search_differences$confidence_ans, search_differences$efficiency, search_differences$ease_of_use, search_differences$utility, search_differences$overall)

combined_search_differences$metric <- factor(combined_search_differences$metric, levels=rev(analyses))

# flip order so that we get bfs - dfs
if(combined_search_differences[1,'search']=="dfs - bfs"){
  combined_search_differences$search = 'bfs - dfs'
  combined_search_differences$diff_in_rating = -1 * combined_search_differences$diff_in_rating
}

combined_search_differences_confidence <- subset(combined_search_differences, metric %in% confidence_metrics)
search_differences_plot_confidence <- combined_search_differences_confidence %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_search_differences_confidence[1,'search'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

search_differences_plot_confidence

View intervals

fit_info_search_differences_confidence <- combined_search_differences_confidence %>% group_by(search, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_search_differences_confidence
## # A tibble: 4 x 8
## # Groups:   search [1]
##   search    metric         diff_in_rating  .lower .upper .width .point .interval
##   <chr>     <fct>                   <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs - dfs confidence.ans        -0.0341 -0.309  0.254    0.95 mean   qi       
## 2 bfs - dfs confidence.ud…         0.0333 -0.244  0.297    0.95 mean   qi       
## 3 bfs - dfs confidence.ans        -0.0341 -0.129  0.0604   0.5  mean   qi       
## 4 bfs - dfs confidence.ud…         0.0333 -0.0569 0.126    0.5  mean   qi
combined_search_differences_preference <- subset(combined_search_differences, metric %in% preference_metrics)
search_differences_plot_preference <- combined_search_differences_preference %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_search_differences_preference[1,'search'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()
search_differences_plot_preference

View intervals

fit_info_search_differences_preference <- combined_search_differences_preference %>% group_by(search, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_search_differences_preference
## # A tibble: 8 x 8
## # Groups:   search [1]
##   search    metric      diff_in_rating  .lower .upper .width .point .interval
##   <chr>     <fct>                <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 bfs - dfs overall              0.284 -0.0561  0.628   0.95 mean   qi       
## 2 bfs - dfs utility              0.388 -0.0469  0.819   0.95 mean   qi       
## 3 bfs - dfs ease.of.use          0.537  0.188   0.880   0.95 mean   qi       
## 4 bfs - dfs efficiency           0.546  0.140   0.959   0.95 mean   qi       
## 5 bfs - dfs overall              0.284  0.163   0.401   0.5  mean   qi       
## 6 bfs - dfs utility              0.388  0.240   0.537   0.5  mean   qi       
## 7 bfs - dfs ease.of.use          0.537  0.420   0.657   0.5  mean   qi       
## 8 bfs - dfs efficiency           0.546  0.400   0.690   0.5  mean   qi

Differences in Oracle

combined_oracle_differences <- rbind(oracle_differences$confidence_udata, oracle_differences$confidence_ans, oracle_differences$efficiency, oracle_differences$ease_of_use, oracle_differences$utility, oracle_differences$overall)

combined_oracle_differences$metric <- factor(combined_oracle_differences$metric, levels=rev(analyses))

combined_oracle_differences_confidence <- subset(combined_oracle_differences, metric %in% confidence_metrics)
oracle_differences_plot_confidence <- combined_oracle_differences_confidence %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_oracle_differences_confidence[1,'oracle'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

oracle_differences_plot_confidence

View intervals

fit_info_oracle_differences_confidence <- combined_oracle_differences_confidence %>% group_by(oracle, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_oracle_differences_confidence
## # A tibble: 4 x 8
## # Groups:   oracle [1]
##   oracle       metric      diff_in_rating  .lower .upper .width .point .interval
##   <chr>        <fct>                <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 dziban - co… confidence…          0.187 -0.0885  0.460   0.95 mean   qi       
## 2 dziban - co… confidence…          0.237 -0.0342  0.509   0.95 mean   qi       
## 3 dziban - co… confidence…          0.187  0.0925  0.283   0.5  mean   qi       
## 4 dziban - co… confidence…          0.237  0.145   0.330   0.5  mean   qi
combined_oracle_differences_preference <- subset(combined_oracle_differences, metric %in% preference_metrics)
oracle_differences_plot_preference <- combined_oracle_differences_preference %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_oracle_differences_preference[1,'oracle'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()
oracle_differences_plot_preference

View intervals

fit_info_oracle_differences_preference <- combined_oracle_differences_preference %>% group_by(oracle, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_oracle_differences_preference
## # A tibble: 8 x 8
## # Groups:   oracle [1]
##   oracle         metric    diff_in_rating  .lower .upper .width .point .interval
##   <chr>          <fct>              <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 dziban - comp… overall            0.164 -0.182   0.535   0.95 mean   qi       
## 2 dziban - comp… utility            0.295 -0.112   0.724   0.95 mean   qi       
## 3 dziban - comp… ease.of.…          0.144 -0.191   0.486   0.95 mean   qi       
## 4 dziban - comp… efficien…          0.286 -0.125   0.688   0.95 mean   qi       
## 5 dziban - comp… overall            0.164  0.0413  0.285   0.5  mean   qi       
## 6 dziban - comp… utility            0.295  0.149   0.441   0.5  mean   qi       
## 7 dziban - comp… ease.of.…          0.144  0.0256  0.259   0.5  mean   qi       
## 8 dziban - comp… efficien…          0.286  0.151   0.428   0.5  mean   qi

dfs compassql vs bfs dziban

combined_alg_differences <- rbind(alg_differences$confidence_udata, alg_differences$confidence_ans, alg_differences$efficiency, alg_differences$ease_of_use, alg_differences$utility, alg_differences$overall)
combined_alg_differences$metric <- factor(combined_alg_differences$metric, levels=rev(analyses))


# flip order so that we get bfs - dfs
if(combined_alg_differences[1,'alg']=="dfs - bfs"){
  combined_alg_differences$alg = 'bfs - dfs'
  combined_alg_differences$diff_in_rating = -1 * combined_alg_differences$diff_in_rating
}

combined_alg_differences_confidence <- subset(combined_alg_differences, metric %in% confidence_metrics)
alg_differences_plot_confidence <- combined_alg_differences_confidence %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_alg_differences_confidence[1,'alg'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()

alg_differences_plot_confidence

View intervals

fit_info_alg_differences_confidence <- combined_alg_differences_confidence %>% group_by(alg, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_alg_differences_confidence
## # A tibble: 4 x 8
## # Groups:   alg [1]
##   alg            metric    diff_in_rating .lower  .upper .width .point .interval
##   <chr>          <fct>              <dbl>  <dbl>   <dbl>  <dbl> <chr>  <chr>    
## 1 dfs compassql… confiden…         -0.150 -0.533  0.233    0.95 mean   qi       
## 2 dfs compassql… confiden…         -0.266 -0.650  0.117    0.95 mean   qi       
## 3 dfs compassql… confiden…         -0.150 -0.283 -0.0167   0.5  mean   qi       
## 4 dfs compassql… confiden…         -0.266 -0.400 -0.133    0.5  mean   qi
combined_alg_differences_preference <- subset(combined_alg_differences, metric %in% preference_metrics)
alg_differences_plot_preference <- combined_alg_differences_preference %>%
      ggplot(aes(x = diff_in_rating, y = metric)) +
      ylab("Confidence") +
      xlab(paste0("Expected Difference in Rating (",combined_alg_differences_preference[1,'alg'],")")) +
      stat_halfeye(.width = c(.95, .5)) +
      geom_vline(xintercept = 0, linetype = "longdash") +
      theme_minimal()
alg_differences_plot_preference

View intervals

fit_info_alg_differences_preference <- combined_alg_differences_preference %>% group_by(alg, metric) %>% mean_qi(diff_in_rating, .width = c(.95, .5))
fit_info_alg_differences_preference
## # A tibble: 8 x 8
## # Groups:   alg [1]
##   alg             metric   diff_in_rating .lower  .upper .width .point .interval
##   <chr>           <fct>             <dbl>  <dbl>   <dbl>  <dbl> <chr>  <chr>    
## 1 dfs compassql … overall          -0.440 -0.950  0.0333   0.95 mean   qi       
## 2 dfs compassql … utility          -0.670 -1.27  -0.0667   0.95 mean   qi       
## 3 dfs compassql … ease.of…         -0.669 -1.13  -0.167    0.95 mean   qi       
## 4 dfs compassql … efficie…         -0.817 -1.38  -0.233    0.95 mean   qi       
## 5 dfs compassql … overall          -0.440 -0.617 -0.267    0.5  mean   qi       
## 6 dfs compassql … utility          -0.670 -0.883 -0.467    0.5  mean   qi       
## 7 dfs compassql … ease.of…         -0.669 -0.833 -0.5      0.5  mean   qi       
## 8 dfs compassql … efficie…         -0.817 -1.02  -0.617    0.5  mean   qi